<#include "../base.ftl"/>
<#macro cssfile>
</#macro>

<#macro scriptfile>
</#macro>

<#macro breadcrumb>
	<ul class="breadcrumb">
	  <#include "../index-menu.ftl"/>
	 <li class="active">收发文件</li>
	</ul>
</#macro>

<#macro title>
广大物流云平台
</#macro>
<#macro jsscript>

//  function initJqGridHideDtlBtn(){
//	$("#add_gridFileTable").hide();
//  }

  function setBeanName(params,postdata){
	  var shippingId = $("#gridTable").jqGrid(
	            "getGridParam", "selrow");
	  //alert(shippingId);
	  var add_data=new Object();
	     add_data["shippingId"]=shippingId;
	     add_data["status"]='1';
	     //add_data["beanName"] = "tsm.TsmFile";
	     
	     return add_data;
  }

 $(function(){
    $("#gridFileTable").jqGrid({
    //list表格获取地址
        //list表格数据获取地址
        url:'${request.contextPath}/list/mainConsole/TsmFile/list.html',
        //list表格编辑地址
        editurl :'${request.contextPath}/operator/tsm/TsmFile/operator.html',
        datatype: "json",
        mtype:"POST",
        height: 400,
        colNames:['文件编号','船舶编号','文件名','文件地址','备注','收发标志','状态','创建人','创建日期','最后修改人','最后修改时间'],
        colModel:[
            {name:'fileId',jsonmap:'FILE_ID',index:'FILE_ID',editable:false,hidden:true},          
            {name:'shippingId',jsonmap:'SHIPPING_ID',editable:true,index:'SHIPPING_ID',hidden:true},
            {name:'fileName',jsonmap:'FILE_NAME',editable:true,index:'FILE_NAME',editrules:{required:true}},
            {name:'fileUrl',jsonmap:'FILE_URL',editable:true,index:'FILE_URL',editrules:{required:true},edittype:'file'},   
            {name:'remark',jsonmap:'REMARK',editable:true,index:'REMARK',editrules:{required:true},hidden:true},
            {name:'sendFlag',jsonmap:'SEND_FLAG',editable:true,index:'SEND_FLAG',editrules:{required:true,date:true},hidden:true},
            {name:'status',jsonmap:'STATUS',index:'STATUS',editable:false,hidden:true},
            {name:'createdBy',jsonmap:'CREATED_BY',editable:false,hidden:true},
            {name:'createdDate',jsonmap:'CREATED_DATE',editable:false,hidden:true,
                editoptions :  {dataInit: function(element) {
                    $(element).datepicker({changeMonth : true,changeYear : true,dateFormat : 'yy-mm-dd'});
                }}       
            },
            {name:'lastUpdBy',jsonmap:'LAST_UPD_BY',editable:false,hidden:true},
            {name:'lastUpdDate',jsonmap:'LAST_UPD_DATE',editable:false,hidden:true,
              editoptions :  {dataInit: function(element) {
                    $(element).datepicker({changeMonth : true,changeYear : true,dateFormat : 'yy-mm-dd'});
                }}  
            }     
        ],
        sortname:'LAST_UPD_DATE',
        sortorder:'desc',
        viewrecords : true,
        gridview : true,
        rownumbers : true,
        autowidth : true,
        rowNum : 20,
        rowList : [10,20,30],
        //onSelectRow:cellSelect,
        jsonReader : {
            page : "page.pageNo",
            total : "page.totalPages",
            records : "page.totalCount",
            root : "page.result",
            repeatitems : false,
            id : 'FILE_ID'
        },
        
        
        prmNames : {
            rows : "page.pageSize",
            page : "page.pageNo",
            sort : "page.orderBy",
            order : "page.order"
        },
        
        pager : "#gridFilePager",
        caption : "文件列表"
    }).navGrid("#gridFilePager",{
            edit:false,
            //editfunc:editSelect,
            add:true, 
            //addfunc:addVoyage,
            del:false, 
            //delfunc:selectDel,
            search: false
    },{ 
        //edit
        //beforeSubmit:cellSelect,
        reloadAfterSubmit:true,
        closeAfterEdit:true,//新增完毕后关闭
        afterComplete:opertaionPrompt,//更新结束后提示信息
        //onclickSubmit: setBeanName  //触发的事件
    },{
    //add
        reloadAfterSubmit : true,
        closeAfterAdd : true, //新增完毕后关闭
        afterComplete : opertaionPrompt,
        onclickSubmit: setBeanName
    },{
      //del
        reloadAfterSubmit : true, 
        closeAfterEdit : true,  //修改完毕后关闭
        afterComplete : opertaionPrompt, //更新结束后提示信息
        //onclickSubmit: fillCategoryId,    
        
    });
//    initJqGridHideDtlBtn();
});
</#macro>
<#macro main>
           <table id="gridFileTable"></table>
           <div id="gridFilePager"></div>
</#macro>

